/**
 * 
 */
package com.tcc.qa.test.util;

import org.apache.xpath.operations.String;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

/**
 * @company CampusCruiser
 * @author Emily_Wang
 * @date 2012-5-23
 */
public class TableCellFinder {
  public static WebElement getCellLocation(WebDriver driver, String tableId, int row, int column) {
    return driver.findElement(By.xpath("//table[@id='" + tableId + "']/tbody/tr[" + row + "]/td[" + column + "]"));
  }
  public static String getCellValue(WebDriver driver, String tableId, int row, int column) {
    return driver.findElement(By.xpath("//table[@id='" + tableId + "']/tbody/tr[" + row + "]/td[" + column + "]")).getText();
  }

  public static String getCellValue_tbody(WebDriver driver, String tableId, int row, int column) {
    return driver.findElement(By.xpath("//tbody[@id='" + tableId + "']/tbody/tr[" + row + "]/td[" + column + "]")).getText();
  }

}
